﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Wilson/MP/Base.Master" AutoEventWireup="true" CodeBehind="ProOtherEdit.aspx.cs" Inherits="WebsiteAdmin.Wilson.ProInfo.ProOtherEdit" %>
<asp:Content ID="Content1" ContentPlaceHolderID="Head_Title" runat="server">Wilson - 编辑产品附属图 - 产品</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Head_Meta" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="Head_Css" runat="server">
    <style type="text/css">
    div.hide{ display:none;}

		#Dialog {
			position: absolute; 
			z-index: 1000; 
			display: none;
			width: 600px;
			background: #FFFFFF;
			border: 3px #999999 solid; 
		}
		#Dialog h6 {
			width: 580px;
			height: 20px;
			line-height: 20px;
			margin: 0;
			padding: 5px 10px; 
			background: #EFEFEF;
			text-align: right; 
			
		}
		#Dialog div.box {
			width: 600px;
			max-height:500px;
			overflow-y:scroll;
		}
		
		#Dialog div#DialogHtml
		{
		    width: 560px;
			padding: 10px; 
			color: #999;
		}
		
		#DialogHtml a {
			float: left;
			height: 20px; 
			line-height: 20px; 
			margin: 5px 15px 5px 0;
			white-space: nowrap;
		}
		
		#DialogHtml h4{ clear:both; background-color:#efefef; font-size:13px; margin-top:5px; display:block; height: 20px; 
			line-height: 20px; padding:5px;}
		
		#DialogHtml b{ float:left; clear:left; height: 20px; 
		    background-color:#efefef;
			line-height: 20px; 
			margin: 3px 15px 3px 0;
			padding:2px;
			white-space: nowrap;}
		
		
        
        #DialogHtml h4 a,#DialogHtml b a{ margin: 0;}	
		
	</style>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="Head_Script" runat="server">
    <script type="text/javascript" src="/CKFinder/CKFinder.js"></script>
    <script type="text/javascript" src="/Script/Mootools.Smoothbox.js"></script>
    <script type="text/javascript" language="javascript">
        var MenuViewID = 2;
        Array.implement({
            getFirstRadio: function() {
                if (this.length == 0) {
                    return null;
                }
                return this[0];
            }
        });
        window.addEvent('domready', function() {
            $('submitbtn').addEvent('click', function() {
                Update();
            });

            $('ShowLink_BigImg').addEvent('click', function() {
                BrowseServer('Images:/ProOtherInfo/', 'txbImgBigURL', 'ShowView_BigImg');
            });

            $('ShowLink_MediumImg').addEvent('click', function() {
                BrowseServer('Images:/ProOtherInfo/', 'txbImgMediumURL', 'ShowView_MediumImg');
            });

            $('ShowLink_SmallImg').addEvent('click', function() {
                BrowseServer('Images:/ProOtherInfo/', 'txbImgSmallURL', 'ShowView_SmallImg');
            });
        });

        function SetFileField(fileUrl, data) {
            $(data["selectActionData"]).value = fileUrl;
            $(this).setProperty('src', fileUrl);
        }
        function BrowseServer(startupPath, functionData, element) {
            var finder = new CKFinder();
            finder.startupPath = startupPath;
            finder.selectActionData = functionData;
            finder.selectActionFunction = SetFileField.bind(element);
            finder.popup();
        }

        function Update() {
            var txbImgBigURL = $('txbImgBigURL').get('value').trim();
            var txbImgMediumURL = $('txbImgMediumURL').get('value').trim();
            var txbImgSmallURL = $('txbImgSmallURL').get('value').trim();
             new Request.JSON({
                method: 'post',
                url: 'Handler/ProOtherUpdate.ashx',
                data: {
                    PKID:<%=pkid %>,
                    ImgBigURL:txbImgBigURL,
                    ImgMediumURL:txbImgMediumURL,
                    ImgSmallURL:txbImgSmallURL
                },
                noCache: true,
                onSuccess: function(data, text) {
                    if (data.Done == 'Success') { 
                        if(confirm('修改成功，返回列表？')){
                            document.location.href = '/Wilson/ProInfo/ProOtherImgList.aspx?proId='+<%=proId %>;
                        };
                        LightBox.remove();
                    }
                    else
                    {
                        alert('修改失败');
                        LightBox.remove();
                    }
                },
                onFailure: function(xhr) {
                    alert(xhr.statusText);
                    LightBox.remove();
                }
            }).send();
        }

    </script>
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="Body_Top" runat="server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="Body_Content" runat="server">
    <div class="infobox">
    <h3>
        <span>新增产品[<%=proName %>]附属图</span>
		<a href="/Wilson/ProInfo/ProOtherImgList.aspx?proId=<%=proId %>" class="back action">返回产品[<%=proName %>]附属图列表</a>
    </h3>
    <div class="mt10">
    <form id="myForm" action="">
	    <table border="0" cellpadding="0" cellspacing="0" class="table_form">
	    <tr>
	        <td align="right" width="100">产品名称：</td>
	        <td><%=proName %></td>
	    </tr>
	    <tr>
	        <td align="right" width="100">800 x 800：</td>
	        <td>
	            <input type="text" id="txbImgBigURL" name="txbImgURL" style="width:450px; color:#666; background-color:#efefef; border:1px #ccc solid;" readonly="readonly"  value="<%=bigImgUrl %>" /> <font color="red">*&nbsp;</font>
                <a id="ShowLink_BigImg" style="cursor:pointer;cursor:hand;border:solid 1px;padding:0 10px 0 10px;">浏览</a>
	        </td>
	    </tr>
	    <tr>
	        <td align="right" width="100">&nbsp;</td>
            <td>
                <div style=" width:300px; height:224px; overflow:hidden; border:1px #999 solid; background-color:#f8f8f8; clear:both;">
                   <img id="ShowView_BigImg" alt="" src="<%=bigImgUrl %>" />
                </div>
                <i>图片尺寸 800 x 800。</i><br />
                <i>如果图片不能完全填充，请重新选择图片。</i>
            </td>
	    </tr>
	    <tr>
	        <td align="right" width="100">400 x 400：</td>
	        <td>
	            <input type="text" id="txbImgMediumURL" name="txbImgURL" style="width:450px; color:#666; background-color:#efefef; border:1px #ccc solid;" readonly="readonly"  value="<%=mediumImgUrl %>" /> <font color="red">*&nbsp;</font>
                <a id="ShowLink_MediumImg" style="cursor:pointer;cursor:hand;border:solid 1px;padding:0 10px 0 10px;">浏览</a>
	        </td>
	    </tr>
	    <tr>
	        <td align="right" width="100">&nbsp;</td>
            <td>
                <div style=" width:300px; height:224px; overflow:hidden; border:1px #999 solid; background-color:#f8f8f8; clear:both;">
                   <img id="ShowView_MediumImg" alt="" src="<%=mediumImgUrl %>" />
                </div>
                <i>图片尺寸 400 x 400。</i><br />
                <i>如果图片不能完全填充，请重新选择图片。</i>
            </td>
	    </tr>
	    <tr>
	        <td align="right" width="100">40 x 40：</td>
	        <td>
	            <input type="text" id="txbImgSmallURL" name="txbImgURL" style="width:450px; color:#666; background-color:#efefef; border:1px #ccc solid;" readonly="readonly"  value="<%=smallImgUrl %>" /> <font color="red">*&nbsp;</font>
                <a id="ShowLink_SmallImg" style="cursor:pointer;cursor:hand;border:solid 1px;padding:0 10px 0 10px;">浏览</a>
	        </td>
	    </tr>
	    <tr>
	        <td align="right" width="100">&nbsp;</td>
            <td>
                <div style=" width:300px; height:224px; overflow:hidden; border:1px #999 solid; background-color:#f8f8f8; clear:both;">
                   <img id="ShowView_SmallImg" alt="" src="<%=smallImgUrl %>" />
                </div>
                <i>图片尺寸 40 x 40。</i><br />
                <i>如果图片不能完全填充，请重新选择图片。</i>
            </td>
	    </tr>
	    </table>
	    <table border="0" cellpadding="0" cellspacing="0" class="table_form">
			<tr>
				<td width="100" height="40">&nbsp;</td>
				<td>
					<input id="submitbtn" type="button" value="提交" class="btn" />
					<input type="reset" value="重置" class="btn" />
				</td>
			</tr>
		</table>
	</form>
    </div>
</div>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="Body_Foot" runat="server">
</asp:Content>
